<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <title>添加保理合同 - 租房宝金融管理平台</title>
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">

    <%@ include file="/WEB-INF/include/aside.jsp"%>
    <div class="content">
      <header class="header clearfix">
          <h3 class="pull-left">添加保理合同</h3>
       </header>

       <c:if test="${not empty infoMessage}">
            <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
              <fmt:message key="${infoMessage}" />
            </div>
       </c:if>

       <form id="factoringContractCreate" class="form-horizontal" method="post" action="${ctx}/factoring-contracts" data-validate="true">
       
        <div class="row">
         <div class="col-xs-12">
           <div class="panel panel-default feature-panel">
           
             
             <div class="panel-body">
             
               <div class="form-group demo2do-form-group">
               
                 <label class="col-xs-2 control-label">融出方</label>
                 <div class="col-xs-4">
                   <select name="lenderName" class="form-control">
                     <c:forEach var="company" items="${companyList}">
                       <option value="${company.id }">${company.fullName }</option>
                     </c:forEach>
                   </select>
                 </div>
                 
                 <label class="col-xs-2 control-label">融资方</label>
                 <div class="col-xs-4">
                   <select name="borrowerName" class="form-control apps">
                     <c:forEach var="app" items="${appList}">
                       <option value="${app.id }">${app.name }</option>
                     </c:forEach>
                   </select>
                 </div>
               </div>
               
               <div class="form-group demo2do-form-group">
                 <label class="col-xs-2 control-label">保理合同号</label>
                   <div class="col-xs-4">
                     <div class="input-group">
                       <input type="text" name="contractNo" class="form-control" data-validate="required"/>
                     </div>
                   </div>
               </div>
               
               <div class="form-group demo2do-form-group">
                 <label class="col-xs-2 control-label">融资比例</label>
                   <div class="col-xs-4">
                     <div class="input-group">
                       <input type="text" name="advaPct" class="form-control" data-validate="float"/>
                     </div>
                   </div>
                   <label class="col-xs-2 control-label">核销比例</label>
                   <div class="col-xs-4">
                     <div class="input-group">
                       <input name="settlePct" type="text" class="form-control" data-validate="float"/>
                     </div>
                   </div>
               </div>
               
               <div class="form-group demo2do-form-group">
                 <label class="col-xs-2 control-label">融资年化利率</label>
                   <div class="col-xs-4">
                     <div class="input-group">
                       <input type="text" name="intRate" class="form-control" data-validate="float"/>
                     </div>
                   </div>
               </div>
               
               <div class="form-group demo2do-form-group">
               
                 <label class="col-xs-2 control-label">融资计息方式</label>
                 <div class="col-xs-4">
                   <select name="intAccuretype" class="form-control">
                     <c:forEach var="item" items="${IntAccureType}">
                       <option value="${item.ordinal() }"><fmt:message key="${item.key}" /></option>
                     </c:forEach>
                   </select>
                 </div>
                 
                  <label class="col-xs-2 control-label">风险准备金释放方式</label>
                 <div class="col-xs-4">
                   <select name="depositDeductType" class="form-control apps">
                     <c:forEach var="item" items="${DepositDeductType}">
                     <option value="${item.ordinal() }"><fmt:message key="${item.key}" /></option>
                   </c:forEach>
                   </select>
                 </div>
               </div>
               
               <div class="form-group demo2do-form-group">
                 
                 <label class="col-xs-2 control-label">承租方还款宽限期</label>
                 <div class="col-xs-4">
                   <div class="input-group">
                     <input type="number" step = "1" min="0" class="form-control" name="advaMatuterm" data-validate="number"/>
                     <span class="input-group-addon">天</span>
                   </div>
                 </div>
                 
               </div>
               
               <div class="form-group demo2do-form-group">
               
                 <label class="col-xs-2 control-label">风险准备金补充方式</label>
                 <div class="col-xs-4">
                   <select name="arDepositAmtInputType" class="form-control">
                     <c:forEach var="item" items="${ArDepositAmtInputType}">
                       <option value="${item.ordinal() }"><fmt:message key="${item.key}" /></option>
                     </c:forEach>
                   </select>
                 </div>
                 
               </div>
             </div> <!-- end panel-body -->
             
           </div><!-- end panel  -->
           
         </div><!-- end col  -->
         
       </div><!-- end row  -->
       

       <div class="row text-center vertical-margin-20"> 
       
         <button id="submit" type="submit" class="btn btn-success btn-shadow btn-shadow-success demo2do-btn">添加保理合同</button>&nbsp;&nbsp;&nbsp;&nbsp;
         <button type="button" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" data-dismiss="modal">取消添加</button>
     
       </div>
       
       </form>

       <%@ include file="/WEB-INF/include/footer.jsp"%>
       
    </div>

  </div>
  

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datepicker.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datepicker.zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.trigger.js"></script>
<!--   <script> 
    $(document).ready(function() {
      $('.input-date').datepicker({
        format: "yyyy-mm-dd",
        todayBtn: "linked",
        language: "zh-CN",
        orientation: "top left",
        autoclose: true,
        todayHighlight: true
      });
      
      $("#submit").bind('click', function(event) {

        event.preventDefault();
        
        $.post("${ctx}/contracts/add",
    				{
                      name:     $(".customer input[name='name']").val(),
                      mobile:   $(".customer input[name='mobile']").val(),
                      account:  $(".customer input[name='account']").val(),
                      city:     $(".customer select.city").val(),
                      province: $(".customer select.province").val(),    //customer
                      community:       $(".house input[name='community']").val(),
                      bulidArea:       $(".house input[name='bulidArea']").val(),
                      type:            $(".house select.HouseType").val(),
                      room:            $(".house select.room").val(),
                      hall:            $(".house select.hall").val(),
                      houseProvince:   $(".house select.province").val(),
                      houseCity:       $(".house select.city").val(),
                      area:            $(".house select.area").val(),
                      communityDetail: $(".house input[name='communityDetail']").val(),//house
                      monthFee:          $(".contract input[name='monthFee']").val(),
                      begin:         $("#rentDate input[name='start']").val(),//contract
                      end:           $("#rentDate input[name='end']").val(),
                      contractNo:    $(".contract input[name='contractNo']").val(),
                      instrument:    $('.contract select.paymentInstrument').val(),
                      appId: 	   	 $(".contract select.apps").val()   
    				},function(jsonData){
    				  	var param=$.parseJSON(jsonData);
    				  	if(param.code == 0){
    				  		window.location.href="${ctx}"+"/"+param.data.url;
    				  	}else {
    				  		alert(param.message);
    				  	}
    					
    				});
    	});

    });
    
    
    
  </script> -->
  
</body>
</html>
